<template>
	<view>
		<button type="primary" ref="hande" @click="ceshi">修改首页数据</button>
		<test ref="hande"></test>
		<button type="default" @click="senclick">父组件触发子组件</button>
	</view>
</template>

<script>
	import test from '../../components/index/test.vue'
	export default {
		data() {
			return {
				name:'测试111'
			}
		},
		
		components:{
			test
		},
		methods: {
			ceshi(){
				uni.$emit('page-popup', {  
					from: 'index',  
					content: '我是content，改变的数据'  
				});
				uni.navigateBack();
			},
			senclick(){
				console.log('我是触发的事件');
				this.$refs.hande.parentMsg(this.name);
			}
		}
	}
</script>

<style>

</style>
